package com.mrzhu.demo;

/**
 * \* Created with IntelliJ IDEA.
 * \* User: Administrator
 * \* Date: 2021/11/16
 * \* Time: 17:35
 * \* To change this template use File | Settings | File Templates.
 * \* Description:
 * \
 */

//class Shape{
//    public void draw(){
//
//    }
//}
//class Cycle extends Shape{
//    @Override
//    public void draw() {
//        System.out.println("这是一个⚪");
//    }
//}
//
//class React extends Shape{
//    @Override
//    public void draw() {
//        System.out.println("这是一个□");
//    }
//}
//public class TestDemo2 {
//
//    public static void drawMap(Shape shape){
//        shape.draw();
//    }
//    public static void main(String[] args) {
//        Shape shape1=new Cycle();
//        Shape shape2=new React();//向上转型
//        drawMap(shape1);
//        drawMap(shape2);
//    }
//}


interface IShape {
    void draw();
}
class Cycle implements IShape {
    @Override
    public void draw() {
        System.out.println("○");
    }
}
public class Test {
    public static void main(String[] args) {
        IShape shape = new Cycle();
        shape.draw();
    }
}